import request from "./Request";

export default {
    captcha() {
        return request({
            url: "/user/captcha",
            method: 'get',
            showLoading: false,
        })
    },
    login(params) {
        return request({
            url: "/user/login",
            method: 'post',
            data: params,
            showLoading: false,
        })
    },
    qqMail(params) {
        return request({
            url: "/user/code",
            method: 'post',
            data: params,
        })
    },
    register(params) {
        return request({
            url: "/user/register",
            method: 'post',
            data: params
        })
    },
    resetPassword(data) {
        return request({
            url: '/user/resetPassword',
            method: 'put',
            data: data
        })
    },
    searchContact(params) {
        return request({
            url: "/contact/searchContact",
            method: 'get',
            data: params
        })
    },
    searchGroup(params) {
        return request({
            url: "/cluster/searchGroup",
            method: 'get',
            data: params
        })
    },
    addContactApply(params) {
        return request({
            url: "/contact/apply",
            method: 'post',
            data: params
        })
    },
    queryUserContactList() {
        return request({
            url: "/contact/userContactList",
            method: 'get',
        })
    },
    queryClusterContactList() {
      return request({
        url: "/cluster/join/list",
        method: 'get',
      })
    },
    queryContactInfo(params) {
        return request({
            url: "/contact/info",
            method: 'get',
            data: params,
            showLoading: false,
        })
    },
    queryCurrentUserInfo() {
        return request({
            url: "/user/info",
            method: 'get',
            showLoading: false,
        })
    },
    createCluster(params) {
        return request({
            url: "/cluster/create",
            method: 'post',
            data: params,
        })
    },
    updateCluster(params){
        return request({
            url: "/cluster/update",
            method: 'post',
            data: params,
        })
    },
    queryCurrentClusterList(){
        return request({
            url: "/cluster/my/list",
            method: 'get',
        })
    },
    queryContactUserInfo(params) {
        return request({
            url: "/contact/user/info",
            method: 'get',
            data: params,
        })
    },
    blackedContact(params) {
        return request({
            url: "/contact/blacked",
            method: 'post',
            data: params,
        })
    },
    deleteContact(params) {
        return request({
            url: "/contact/delete",
            method: 'post',
            data: params,
        })
    },
    queryClusterByClusterId(params) {
        return request({
            url: "/cluster/detail",
            method: 'get',
            data: params,
        })
    },
    queryClusterUserChatByClusterId(params) {
        return request({
            url: "/cluster/chat",
            method: 'get',
            data: params,
        })
    },
    deleteChat(params) {
        return request({
            url: "/chat/delete",
            method: 'delete',
            data: params,
            showLoading: false,
        })
    },
    clearChat(params) {
        return request({
            url: "/chat/clear",
            method: 'delete',
            data: params,
            showLoading: false,
        })
    },
    topMessage(params) {
        return request({
            url: "/message/top",
            method: 'post',
            data: params,
            showLoading: false,
        })
    },
    addClusterUser(params) {
        return request({
            url: "/cluster/addClusterUser",
            method: 'post',
            data: params,
        })
    },
    delClusterUser(params) {
        return request({
            url: "/cluster/delClusterUser",
            method: 'post',
            data: params,
        })
    },
    dissolutionCluster(params) {
        return request({
            url: "/cluster/dissolution",
            method: 'post',
            data: params,
        })
    },
    leaveCluster(params) {
        return request({
            url: "/cluster/leave",
            method: 'post',
            data: params,
        })
    },
    queryContactApplyList(params) {
        return request({
            url: "/contactApply/list",
            method: 'get',
            data: params,
        })
    },
    deleteContactApply(id) {
      return request({
        url: '/contactApply/' + id,
        method: 'delete'
      })
    },
    dealContactApply(params) {
        return request({
            url: "/contactApply/deal",
            method: 'post',
            data: params,
        })
    },
    logout() {
        return request({
            url: "/user/logout",
            method: 'post',
            showLoading: false,
        })
    },
    updateCurrentUser(params) {
        return request({
            url: "/user/update",
            method: 'post',
            data: params,
        })
    },
    updateUserPassword(params) {
        return request({
            url: "/user/update/password",
            method: 'post',
            data: params,
        })
    },
    sendPrivateMessage(params) {
        return request({
            url: "/message/sendPrivateMessage",
            method: 'post',
            data: params,
            showLoading: false,
        })
    },
    updateReadMsgState(contactId){
        return request({
            url: '/message/' + contactId,
            method: 'put',
            showLoading: false,
        })
    },
    sendClusterMessage(params) {
      return request({
        url: "/message/sendClusterMessage",
        method: 'post',
        data: params,
        showLoading: false,
      })
    },
    minioUpload(params) {
        return request({
            url: "/file/upload",
            method: 'post',
            data: params,
        })
    },
    minioUploadFiles(params) {
        return request({
            url: "/file/uploadFiles",
            method: 'post',
            data: params,
        })
    },
}
